import {authRequest} from '../request';
type Tbody = {
    username:string,
    password:string
}
// 登陆
export const postLogin = (body:Tbody)=>{
    return authRequest.post("/index/login",body)
}
// /auth/index/info
export const getInfo = ()=>{
    // 请求头-》token 写在拦截器中
    return authRequest.get("/index/info");

    // 请求头-》token 未写在拦截器中
    // return authRequest.get("/index/info",{
    //     headers:{
    //         token:localStorage.getItem("token") as string
    //     }
    // });
}
// 退出登陆 /admin/auth/index/logout
export const postLogout = ()=>{
    return authRequest.post("/index/logout");
}